package me.idashu.attg.service;

import me.idashu.attg.domain.AdminEntity;
import me.idashu.attg.persistence.AdminMapper;
import me.idashu.attg.util.MD5Encode;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class AdminService {
	
    @Autowired
	private AdminMapper adminMapper;
    
    public AdminEntity findAdminByNameAndPass(AdminEntity adminEntity){
    	String encodePass = MD5Encode.Md5(adminEntity.getPassword());
    	adminEntity.setPassword(encodePass);
    	AdminEntity admin = adminMapper.findAdminByNameAndPass(adminEntity);
    	return admin;
    }
    
}
